#include "Utils.hh"
#include "BankSystem.hh"
#include "Account.hh"

using namespace BankSystem;


// 查看交易历史
void viewTransactionHistory(const std::shared_ptr<Account>& account) {
    system("clear");
    SetConsoleOutputCP(CP_UTF8);
    const auto& transactions = account->getTransactions();
    
    std::cout << "===== Transaction History for Account: " << account->getAccountId() << " =====" << std::endl;
    
    if (transactions.empty()) {
        std::cout << "No transactions found for this account." << std::endl;
    } else {
        for (const auto& transaction : transactions) {
            std::cout << "--------------------------------------" << std::endl;
            std::cout << transaction->getDetails() << std::endl;
        }
    }
    
    waitForEnter();
}